package top.tangyh.lamp.care.mapper;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import top.tangyh.basic.base.mapper.SuperMapper;
import top.tangyh.lamp.care.entity.BHl7RyDetail;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * Hl7病人入院明细表
 * </p>
 *
 * @author zqb
 * @date 2024-07-15 14:34:11
 * @create [2024-07-15 14:34:11] [zqb] [代码生成器生成]
 */
@Repository
public interface BHl7RyDetailMapper extends SuperMapper<BHl7RyDetail> {

    default BHl7RyDetail selectOneByHospitalNumber(String hospitalNumber) {
        LambdaQueryWrapper<BHl7RyDetail> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(BHl7RyDetail::getHospitalNumber, hospitalNumber)
                .orderByDesc(BHl7RyDetail::getRyTime)
                .last("limit 1");
        return this.selectOne(queryWrapper);
    }
    List<BHl7RyDetail> selectRyListOfTopNewTime(List<String> hospitalNumbers);
}


